// TOWN DIALOGUE SCRIPT
//    Town 0: Sage's Hut (peaceful sage!)

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

short choice;

// *** The Sage ***
begintalknode 1;
	state = -1;
	personality = 6;
	nextstate = 2;
	condition = 1;
	question = "The Sage";
	text1 = "Inside the hut, a kindly old man is staring at you intently.";
	text2 = "He stares into a crystal ball he's carrying and mutters _Yes, yes, they're here._";
	text3 = "He then looks at you and says _Welcome to The Wilderness._";
	text5 = "The Sage seemed to know you were coming.";
	text6 = "He waits patiently for you to speak.";
	action = INTRO;
	code =
		set_flag(0, 0, TRUE);
	break;

begintalknode 2;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = 1;
	question = "What do you do?";
	text1 = "_I am the Sage._ he replies.  _I can aid you in your quest._";
	text2 = "_I can also identify items for you for 1 coin each._ he adds.";
	text3 = "_What is it you wish?_";

begintalknode 3;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = 1;
	question = "Can you identify some items for me?";
	text1 = "The Sage mutters to himself and runs his hands over your equipment.";
	action = ID 1;

begintalknode 4;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = (get_flag(50, 0) == 0);
	question = "Quest?";
	text1 = "The Sage starts speaking _It is known that Zanta broke up the Staff of Turin._";
	text2 = "_It is also known that it was broken into seven pieces and hidden around The Wilderness._";
	text3 = "_Not known to any but me is that there is a piece near or in each of the towns in The Wilderness._";
	text4 = "_You must find the pieces of the Staff of Turin and restore it as the protector of The Wilderness._";
	text5 = "_I await your return with news of success._ the Sage says before going quiet.";
	action = END_TALK;
	code =
		set_flag(50, 0, 1);
		toggle_quest(0, 1);
	break;

begintalknode 5;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = ((get_flag(50, 0) > 0) && (has_special_item(1) == 0) &&
			(has_special_item(2) == 0) && (has_special_item(3) == 0) &&
			(has_special_item(4) == 0) && (has_special_item(5) == 0) &&
			(has_special_item(6) == 0) && (has_special_item(7) == 0));
	question = "Quest?";
	text1 = "The Sage looks in your direction and says _Find the pieces of the Staff._";
	text2 = "The Sage goes mute.";
	action = END_TALK;

begintalknode 6;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = ((get_flag(50, 0) > 0) && ((has_special_item(1) > 0) ||
			(has_special_item(2) > 0) || (has_special_item(3) > 0) ||
			(has_special_item(4) > 0) || (has_special_item(5) > 0) ||
			(has_special_item(6) > 0) || (has_special_item(7) > 0)) &&
			((has_special_item(1) == 0) ||
			(has_special_item(2) == 0) || (has_special_item(3) == 0) ||
			(has_special_item(4) == 0) || (has_special_item(5) == 0) ||
			(has_special_item(6) == 0) || (has_special_item(7) == 0)));
	question = "Quest?";
	text1 = "The Sage says _You've done well to find the pieces of the staff you've found._";
	text2 = "_Visit the other towns in The Wilderness to find those you have not._ the Sage says.";
	text3 = "The Sage again goes quiet.";
	action = END_TALK;
	code =
		run_town_script(10); // give experience for each new piece found
	break;

begintalknode 7;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = ((get_flag(50, 0) > 0) && (has_special_item(1) > 0) &&
			(has_special_item(2) > 0) && (has_special_item(3) > 0) &&
			(has_special_item(4) > 0) && (has_special_item(5) > 0) &&
			(has_special_item(6) > 0) && (has_special_item(7) > 0));
	question = "Quest?";
	text1 = "The Sage intones _You have found all of the pieces of the Staff._";
	text2 = "_You've done well in furthering the quest._ the Sage says.";
	text3 = "_You must restore the Staff to complete the quest._ the Sage adds.";
	text4 = "_To restore the Staff, you must visit the Temple of Narn._";
	text5 = "_There, in front the statue of the Narn God, hold up the pieces and chant this chant._";
	text6 = "The Sage teaches you to chant _Hooey Gooey Gluey_.";
	text7 = "_Please do not delay._ the Sage says before going silent.";
	action = END_TALK;
	code =
		set_flag(50, 2, 1);
		run_town_script(10); // give experience for each new piece
	break;

begintalknode 8;
	state = 2;
	personality = 6;
	nextstate = -1;
	condition = 1;
	question = "Goodbye";
	text1 = "The Sage doesn't even look in your direction as you prepare to leave.";
	action = END_TALK;
